<template>
  <div >
    <div style="display: flex;justify-content: center;padding: 10px 5px;background: #29d;">
      <span style="flex: 1;color: white;font-size: 12px">配送信息</span>
      <a class="button iconfont icon-zengjia" @click="addGoods"></a>
    </div>
    <UTable ref="mTable" :localData="datas" :autoLoadData="false" :columns="goodsColumns" style="margin-top: 0px" />

  </div>

</template>

<script>
  import UTable from '@/components/UTable'
export default {
  components:{
    UTable
  },
   props:['goodsList'],
   data(){
     return {
       datas:[],
       goodsFrom:{},
       showGoodsDialog:false,
        goodsColumns:[
          { type:'edit',inputType:'text', prop: 'goodsName', label: '品名' },
          { type:'edit', inputType:'number',prop: 'qty', label: '数量'},
          { type:'edit',inputType:'text', prop: 'unitname', label: '单位'}
        ]
     }
   },
  watch:{
    goodsList(goodsList){
      this.datas=goodsList
    }
  },
  methods:{
    addGoods(){
       this.datas.push({ goodsName:'',qty:0,unitname:''})

    }
  }
}
</script>

<style scoped>
  .button{
    font-size: 14px;
    color: white;

  }
</style>
